<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html lang="zxx">

<head>
    <style>
        .card {
            border-radius: 15px;
            overflow: hidden;
            box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.08);
        }
        
        .table thead th {
            border-bottom: 2px solid #e9ecef;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            font-size: 0.85rem;
        }
        
        .status-indicator {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            display: inline-block;
        }
        
        .badge {
            font-weight: 500;
            letter-spacing: 0.05em;
        }
        
        .empty-state {
            opacity: 0.6;
            padding: 3rem 0;
        }
        
        .page-item.active .page-link {
            background-color: #007bff;
            border-color: #007bff;
        }
        
        .table-hover tbody tr:hover {
            background-color: #f8f9fa;
            transform: translateY(-2px);
            transition: all 0.3s ease;
        }
        .revoke-btn {
            transition: all 0.3s ease;
            min-width: 60px;
        }
        .revoke-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        }
        </style>
    <meta charset="UTF-8">
    <meta name="description" content="Flyplane Template">
    <meta name="keywords" content="Flyplane, unica, creative, html">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>退票申请记录</title>

    <!-- Google Font -->
    <link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@200;300;400;600;700;800;900&display=swap"
    rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">

    <!-- Css Styles -->
    <link rel="stylesheet" href="qt/css/bootstrap.min.css" type="text/css">
    <link rel="stylesheet" href="qt/css/font-awesome.min.css" type="text/css">
    <link rel="stylesheet" href="qt/css/elegant-icons.css" type="text/css">
    <link rel="stylesheet" href="qt/css/barfiller.css" type="text/css">
    <link rel="stylesheet" href="qt/css/magnific-popup.css" type="text/css">
    <link rel="stylesheet" href="qt/css/nice-select.css" type="text/css">
    <link rel="stylesheet" href="qt/css/slick.css" type="text/css">
    <link rel="stylesheet" href="qt/css/owl.carousel.min.css" type="text/css">
    <link rel="stylesheet" href="qt/css/slicknav.min.css" type="text/css">
    <link rel="stylesheet" href="qt/css/style.css" type="text/css">
</head>

<body>
    <!-- Page Preloder -->
    <div id="preloder">
        <div class="loader"></div>
    </div>

    <!-- Offcanvas Menu Begin -->
    <div class="offcanvas-menu-overlay"></div>
    <div class="offcanvas-menu-wrapper">
        <div class="offcanvas__logo">
            <a href="#"><img src="qt/img/logo.png" alt=""></a>
        </div>
        <div id="mobile-menu-wrap"></div>
        <div class="offcanvas__widget">
            <ul>
                <li><span class="icon_pin"></span> 84 Forest Ave, Lake Grove, New York</li>
                <li><span class="icon_phone"></span> (+12) 345-678-91012</li>
                <li><span class="icon_mail"></span> contact.17sucai@gmail.com</li>
            </ul>
        </div>
        <div class="offcanvas__social">
            <a href="#"><span class="social_facebook"></span></a>
            <a href="#"><span class="social_twitter"></span></a>
            <a href="#"><span class="social_youtube"></span></a>
            <a href="#"><span class="social_skype"></span></a>
        </div>
    </div>
    <!-- Offcanvas Menu End -->

    <!-- Header Section Begin -->
    <header class="header">
        <div class="container">
            <div class="header__top">
                <div class="row">
                    <div class="col-lg-9">
                        <div class="header__top__widget">
                            <ul>
                                <li><span class="icon_pin"></span> 84 Forest Ave, Lake Grove, New York</li>
                                <li><span class="icon_phone"></span> (+12) 345-678-91012</li>
                                <li><span class="icon_mail"></span> contact.17sucai@gmail.com</li>
                            </ul>
                        </div>
                    </div>
                    <div class="col-lg-3">
                        <div class="header__top__social">
                            <a href="#"><span class="social_facebook"></span></a>
                            <a href="#"><span class="social_twitter"></span></a>
                            <a href="#"><span class="social_youtube"></span></a>
                            <a href="#"><span class="social_skype"></span></a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="header__options">
                <div class="row">
                    <div class="col-lg-3">
                        <div class="header__logo">
                            <a href="./index.html"><img src="qt/img/logo.png" alt=""></a>
                        </div>
                    </div>
                    <div class="col-lg-9">
                        <nav class="header__menu mobile-menu">
                            <ul>
                                <li><a href="user_index.jsp">首页</a></li>
                                <li class="active"><a href="#">我的订单</a>
                                    <ul class="dropdown">
                                        <li><a href="TicketListServlet?pageNo=1">订单列表</a></li>
                                        <li><a href="ChangeTicketListServlet?pageNo=1">改签申请记录</a></li>
                                        <li class="active"><a href="QuitListByUserIdServlet?pageNo=1">退票申请记录</a></li>
                                    </ul>
                                </li>
                                <li><a href="FlightListServlet?pageNo=1">航班大厅</a></li>
                                <li><a href="./about.html">About Us</a></li>
                                <li><a href="./contact.html">Contacts</a></li>
                            </ul>
                        </nav>
                    </div>
                </div>
            </div>
            <div class="canvas__open"><i class="fa fa-bars"></i></div>
        </div>
    </header>
    <!-- Header Section End -->

    <!-- Breadcrumb Begin -->
    <div class="breadcrumb-option spad set-bg" data-setbg="qt/img/breadcrumb-bg.jpg">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <div class="breadcrumb__text">
                        <div class="breadcrumb__links">
                            <a href="./index.html">首页</a>
                            <span>我的订单</span>
                            <span>退票申请记录</span>
                        </div>
                        <h2>退票申请记录</h2>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- Breadcrumb End -->

    <section class="places spad">
        <div class="container">
            <div class="card border-0 shadow-lg">
                <div class="card-header bg-primary text-white">
                    <h4 class="mb-0"><i class="fa fa-ticket mr-2"></i>我的退票记录</h4>
                </div>
                
                <div class="card-body p-0">
                    <div class="table-responsive">
                        <table class="table table-hover mb-0">
                            <thead class="thead-dark">
                                <tr>
                                    <th style="width: 25%">航班号</th>
                                    <th style="width: 20%">座位号</th>
                                    <th style="width: 20%">金额</th>
                                    <th style="width: 25%">状态</th>
                                    <th style="width: 10%">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <c:choose>
                                    <c:when test="${not empty list}">
                                        <c:forEach items="${list}" var="order">
                                            <tr class="align-middle">
                                                <td>
                                                    <div class="d-flex align-items-center">
                                                        <i class="fa fa-plane fa-2x text-primary mr-3"></i>
                                                        <div>
                                                            <h5 class="mb-0">${order.flightId}</h5>
                                                            <small class="text-muted">航班号</small>
                                                        </div>
                                                    </div>
                                                </td>
                                                <td>
                                                    <div class="d-flex align-items-center">
                                                        <i class="fa fa-chair fa-2x text-success mr-3"></i>
                                                        <div>
                                                            <h5 class="mb-0">${order.seatNumber}</h5>
                                                            <small class="text-muted">座位号</small>
                                                        </div>
                                                    </div>
                                                </td>
                                                <td>
                                                    <span class="text-success font-weight-bold">
                                                            ¥ ${order.price} 
                                                    </span>
                                                </td>
                                                <td>
                                                    <div class="d-flex align-items-center">
                                                        <span class="status-indicator bg-${order.status == '已支付'? 'success' : 
                                                            order.status == '已退票'? 'danger' : 
                                                            order.status == '已使用'? 'secondary' : 'primary'} 
                                                            mr-2" style="color: black;"></span>
                                                        <span class="badge badge-${order.status == '已支付'? 'success' : 
                                                            order.status == '已退票'? 'danger' : 
                                                            order.status == '已使用'? 'secondary' : 'primary'} 
                                                            badge-pill py-2 px-3" style="color: black;">
                                                            ${order.status}
                                                        </span>
                                                    </div>
                                                </td>
                                                <td>
                                                    <form action="RevokeQuitServlet" method="post" onsubmit="return confirm('确认要撤销该退票申请吗？');">
                                                        <input type="hidden" name="flightId" value= "${order.flightId}">
                                                        <button type="submit" class="btn btn-outline-danger btn-sm">
                                                            撤销
                                                        </button>
                                                    </form>
                                                </td>
                                            </tr>
                                        </c:forEach>
                                    </c:when>
                                    <c:otherwise>
                                        <tr>
                                            <td colspan="5" class="text-center py-5">
                                                <div class="empty-state">
                                                    <i class="fa fa-ticket fa-4x text-muted mb-3"></i>
                                                    <h3 class="text-muted">暂无机票订单</h3>
                                                    <p class="text-muted">您还没有预订过任何航班</p>
                                                </div>
                                            </td>
                                        </tr>
                                    </c:otherwise>
                                </c:choose>
                            </tbody>
                        </table>
                    </div>
                </div>
    
                    <!-- 分页 -->
                    <c:if test="${box.totalPages > 1}">
                        <div class="card-footer bg-white">
                            <nav aria-label="Page navigation">
                                <ul class="pagination justify-content-center mb-0">
                                    <li class="page-item ${box.pageNo == 1 ? 'disabled' : ''}">
                                        <a class="page-link" 
                                            href="QuitListByUserIdServlet?pageNo=${box.pageNo - 1}" 
                                            aria-label="Previous">
                                            <span aria-hidden="true">&laquo;</span>
                                        </a>
                                    </li>
                                    
                                    <c:forEach begin="1" end="${box.totalPages}" var="i">
                                        <li class="page-item ${i == box.pageNo ? 'active' : ''}">
                                            <a class="page-link" 
                                                href="QuitListByUserIdServlet?pageNo=${i}">${i}</a>
                                        </li>
                                    </c:forEach>
                                    
                                    <li class="page-item ${box.pageNo == box.totalPages ? 'disabled' : ''}">
                                        <a class="page-link" 
                                            href="QuitListByUserIdServlet?pageNo=${box.pageNo + 1}" 
                                            aria-label="Next">
                                            <span aria-hidden="true">&raquo;</span>
                                        </a>
                                    </li>
                                </ul>
                            </nav>
                        </div>
                    </c:if>
                </div>
            </div>
        </div>
    </section>
    

    <!-- Footer Section Begin -->
    <footer class="footer spad">
        <div class="container">
            <div class="row d-lfex justify-content-center">
                <div class="col-lg-7">
                    <div class="footer__text">
                        <div class="footer__about">
                            <div class="footer__logo">
                                <a href="#"><img src="qt/img/footer-logo.png" alt=""></a>
                            </div>
                            <p>Nullam ultrices tortor non diam ullamcorper auctor. In urna tellus, auctor sit amet est
                            ut, scelerisque volutpat diam.</p>
                        </div>
                        <div class="footer__social">
                            <a href="#"><span class="social_facebook"></span></a>
                            <a href="#"><span class="social_twitter"></span></a>
                            <a href="#"><span class="social_youtube"></span></a>
                            <a href="#"><span class="social_skype"></span></a>
                        </div>
                        <div class="footer__nav">
                            <ul>
                                <li><a href="./index.html">Home</a></li>
                                <li><a href="#">Pages</a></li>
                                <li><a href="./blog.html">Blog</a></li>
                                <li><a href="./about.html">About Us</a></li>
                                <li><a href="./contact.html">Contacts</a></li>
                            </ul>
                        </div>
                        
                        <p class="footer__copyright">Copyright &copy;<script>document.write(new Date().getFullYear());</script> All rights reserved | This template is made with <i class="fa fa-heart color-danger" aria-hidden="true"></i> by <a href="https://www.17sucai.com" target="_blank" rel="nofollow noopener">17sucai</a>
                        </p>
                        
                    </div>
                </div>
            </div>
        </div>
    </footer>
    <!-- Footer Section End -->

    <!-- Js Plugins -->
    <script src="qt/js/jquery-3.3.1.min.js"></script>
    <script src="qt/js/bootstrap.min.js"></script>
    <script src="qt/js/jquery.barfiller.js"></script>
    <script src="qt/js/jquery.magnific-popup.min.js"></script>
    <script src="qt/js/jquery.nice-select.min.js"></script>
    <script src="qt/js/slick.min.js"></script>
    <script src="qt/js/jquery.slicknav.js"></script>
    <script src="qt/js/owl.carousel.min.js"></script>
    <script src="qt/js/datepicker.min.js"></script>
    <script src="qt/js/main.js"></script>

</body>

</html>